import type { ImageData } from "../../../model/Interfaces";
import { readInt32LE, readUInt32LE, toUTF8String } from "../BytesUtils";

export const BMP: ImageData = {
    validate: (input) => toUTF8String(input, 0, 2) === 'BM',
    calculate: (input) => ({
        height: Math.abs(readInt32LE(input, 22)),
        width: readUInt32LE(input, 18),
    }),
}